This invention relates to a method and apparatus for performing anti-aliasing on images and, in particular, on computer graphic images rendering in either three dimensions or two dimensions.
When scenes are rendered in a computer graphics system in either 3D or 2D, the quality of the images can often be improved, especially around the edges of objects. The nature of computer images means that they are usually derived by taking discrete samples of data across a rectilinear grid. This can introduce aliasing artifacts into the scene at edges of objects, therefore leaving boundary lines with jagged or staircase edges. This is a well-known problem and many methods have been proposed to anti-alias lines usually by altering the contribution a line or edge makes to a pixel based on the amount of that pixel which it covers. For computer-generated images, anti-aliasing is usually performed during the image's conversion from a vector-based representation to a raster-based image, or directly from the rasterised presentation.
Pre-filtering of objects usually gives the best anti-aliasing results but can be expensive to achieve. Therefore, in many real time graphics applications, post filtering in the form of super-sampling and multi-sampling is usually used. This enables all the anti-aliasing required to be achieved in a single pass of a filter, although the results it produces are not always of such high quality as can be obtained by pre-filtering. It is, however, far less expensive to implement.
The anti-aliasing results produced by super-sampling techniques have been found to improve with higher sampling rates but at the cost of additional computer power and additional memory. These increase significantly since a 2×2 super-sampling array can require four times as much memory and computation effort as a system with no super-sampling. A system with 4×4 super-sampling can take sixteen times as much computation and memory requirements.
As a result, many variations using different filters and patterns have been devised to give better results using smaller sample sizes. Such patterns include grid, rotated grid and stochastic sampling.
In any super-sampling system, the down sampling filter that is chosen represents a trade-off between the desired elimination of aliasing, the over-filtering of the image which may result in blurring, and the implementation cost. The choice is usually a compromise between an acceptable amount of aliasing and image blurring. In some systems, down filtering can be performed ‘on the fly’ as part of the display sub-system. If this is achieved then there is no need for a physical buffer to store the target resolution anti-aliased image. Systems such as these are preferably used as they can reduce the memory bandwidth requirements in real time rendering applications.
When super-sampling is performed on a graphic scene, the result is that the whole scene may become slightly blurred as a result of the filtering which takes place. This softens any hard-edged lines that are present. For most 3D or 2D animated graphics this is not a problem and usually is desirable. However, it can be a problem when rendering user interface elements such as “head-up display” parts of an image where the user expects to see crisp anti-aliased edges. For example, borders of windows and menus and specially created fonts are usually expected to have well-defined crisp edges. An example of the effects of super-sampling on a menu window is shown in FIGS. 2 A and B. In this, it can be seen that the text within the menu and the cursor do not have the expected degree of sharpness associated with menu displays. Enlargement of the menu portion of the image at FIG. 2B shows the blurring effect. One way of dealing with this effect on menu displays is to render the user interface elements such as the menu at FIG. 2 into a separate buffer. Thus a different anti-aliasing technique is then used which maintains sharpness. This portion of the image can then be copied pixel by pixel onto the anti-alias three-dimensional or two-dimensional image.
It will be appreciated that such a solution incurs additional cost in the use of the additional memory buffer, the computational cost of copying the data across, and the synchronisation required between the two systems. This synchronisation problem is even more of an issue with systems that perform super-sampling filtering in real time in a display sub system.